package com.fan.mapper;

import com.fan.pojo.User;
import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.beans.factory.annotation.Autowired;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author およそ神
 * @version JDK 16
 */
public class UserMapperImpl extends SqlSessionDaoSupport implements UserMapper {
   @Override
   @Resource
   public List<User> selectUser() {
      UserMapper mapper = getSqlSession().getMapper(UserMapper.class);
      return mapper.selectUser();
   }

   @Override
   public int addUser(User user) {
      return getSqlSession().getMapper(UserMapper.class).addUser(user);
   }

   @Override
   public int deleteUser(int id) {
       return getSqlSession().getMapper(UserMapper.class).deleteUser(id);
   }
}
